/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * frmTimKiemNhanh.java
 *
 * Created on Aug 22, 2012, 3:07:43 PM
 */
package gui;

/**
 *
 * @author dtth
 */
public class frmTimKiemNhanh extends javax.swing.JFrame {
    
//    /// Vùng xây dựng các phương thức
//    public void CreateHeaderTableSanPham() {
//        try {
//            TableModel = new DefaultTableModel(new Vector(),0);
//            rowHeader.addElement("STT");    
//            rowHeader.addElement("Mã SP");
//            rowHeader.addElement("Tên SP");    
//            rowHeader.addElement("Số Lượng");
//            rowHeader.addElement("Đơn Giá");    
//            rowHeader.addElement("ĐVT");    
//            rowHeader.addElement("Thành Tiền");
//            
//            TableModel = new DefaultTableModel(rowHeader, 0);
//            jTableListSanPham.setModel(TableModel);
//        } catch(Exception ex) {
//            
//        }
//    }
//    
//    public void CreateTableSanPham(String prMaSP, String prTenSP, String prSoLuong, String prDVT, String prDonGia, String prThanhTien) {
//        try {
//            for (int i = TableModel.getRowCount() - 1; i >= 0; i-- ){
//                String strMaSP = jTableListSanPham.getModel().getValueAt(i, 1).toString();
//                Double dSLSPTable = Double.valueOf(jTableListSanPham.getModel().getValueAt(i, 3).toString());
//                Double dSLSPMoi = Double.valueOf(prSoLuong);
//                Double dSLSP = dSLSPTable + dSLSPMoi;
//                if(strMaSP.equals(prMaSP)) {
//                    jTableListSanPham.getModel().setValueAt(dSLSP, i, 3);
//                    return;
//                }
//            }
//
//            Vector row = new Vector();
//            row.addElement(String.valueOf(iSoLuongSP));
//            row.addElement(prMaSP);
//            row.addElement(prTenSP);
//            row.addElement(prSoLuong);
//            row.addElement(prDonGia);
//            row.addElement(prDVT);
//            row.addElement(prThanhTien);
//            row.addElement(prMaSP);
//            TableModel.addRow(row);
//            iSoLuongSP++;
//            jTableListSanPham.setModel(TableModel);
//        } catch(Exception ex) {
//            
//        }
//    }
//    /// Kết thúc vùng xây dựng các phương thức
    /** Creates new form frmTimKiemNhanh */
    public frmTimKiemNhanh() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jrbtnTimTheoHoaDon = new javax.swing.JRadioButton();
        jrbtnTimTheoPhieuNhap = new javax.swing.JRadioButton();
        jPanel2 = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        jrbtnTimTheoPhieuNhap1 = new javax.swing.JRadioButton();
        jLabel7 = new javax.swing.JLabel();
        jrbtnTimTheoPhieuNhap2 = new javax.swing.JRadioButton();
        jpnlTimTheoHoaDon = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        jDateChooser1 = new com.toedter.calendar.JDateChooser();
        jDateChooser2 = new com.toedter.calendar.JDateChooser();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("TÌM KIẾM");

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel2.setText("Chọn tìm kiếm:");

        jrbtnTimTheoHoaDon.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jrbtnTimTheoHoaDon.setText("Hóa đơn");
        jrbtnTimTheoHoaDon.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jrbtnTimTheoHoaDonItemStateChanged(evt);
            }
        });

        jrbtnTimTheoPhieuNhap.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jrbtnTimTheoPhieuNhap.setText("Phiếu nhập");
        jrbtnTimTheoPhieuNhap.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jrbtnTimTheoPhieuNhapItemStateChanged(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel2)
                .addGap(29, 29, 29)
                .addComponent(jrbtnTimTheoHoaDon)
                .addGap(35, 35, 35)
                .addComponent(jrbtnTimTheoPhieuNhap)
                .addContainerGap(387, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGap(8, 8, 8)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jrbtnTimTheoHoaDon)
                    .addComponent(jrbtnTimTheoPhieuNhap))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jrbtnTimTheoPhieuNhap1.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jrbtnTimTheoPhieuNhap1.setText("Nhân viên lập");
        jrbtnTimTheoPhieuNhap1.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jrbtnTimTheoPhieuNhap1ItemStateChanged(evt);
            }
        });

        jLabel7.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel7.setText("TÌM KIẾM THEO");

        jrbtnTimTheoPhieuNhap2.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jrbtnTimTheoPhieuNhap2.setText("Ngày lập");
        jrbtnTimTheoPhieuNhap2.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jrbtnTimTheoPhieuNhap2ItemStateChanged(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jrbtnTimTheoPhieuNhap1)
                    .addComponent(jLabel7)
                    .addComponent(jrbtnTimTheoPhieuNhap2))
                .addContainerGap(21, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel7)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jrbtnTimTheoPhieuNhap1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jrbtnTimTheoPhieuNhap2)
                .addContainerGap(59, Short.MAX_VALUE))
        );

        jpnlTimTheoHoaDon.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel3.setText("Mã HD");

        jTextField1.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel4.setText("Tên HD");

        jTextField2.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        jDateChooser1.setDateFormatString("dd/MM/yyyy");

        jDateChooser2.setDateFormatString("dd/MM/yyyy");

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel5.setText("Tên HD");

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel6.setText("Tên HD");

        javax.swing.GroupLayout jpnlTimTheoHoaDonLayout = new javax.swing.GroupLayout(jpnlTimTheoHoaDon);
        jpnlTimTheoHoaDon.setLayout(jpnlTimTheoHoaDonLayout);
        jpnlTimTheoHoaDonLayout.setHorizontalGroup(
            jpnlTimTheoHoaDonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpnlTimTheoHoaDonLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpnlTimTheoHoaDonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpnlTimTheoHoaDonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(jpnlTimTheoHoaDonLayout.createSequentialGroup()
                            .addComponent(jLabel3)
                            .addGap(25, 25, 25))
                        .addComponent(jLabel5)
                        .addComponent(jLabel4))
                    .addComponent(jLabel6))
                .addGap(18, 18, 18)
                .addGroup(jpnlTimTheoHoaDonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jDateChooser1, javax.swing.GroupLayout.DEFAULT_SIZE, 304, Short.MAX_VALUE)
                    .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 304, Short.MAX_VALUE)
                    .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 304, Short.MAX_VALUE)
                    .addComponent(jDateChooser2, javax.swing.GroupLayout.DEFAULT_SIZE, 304, Short.MAX_VALUE))
                .addContainerGap())
        );
        jpnlTimTheoHoaDonLayout.setVerticalGroup(
            jpnlTimTheoHoaDonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpnlTimTheoHoaDonLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpnlTimTheoHoaDonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(4, 4, 4)
                .addGroup(jpnlTimTheoHoaDonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpnlTimTheoHoaDonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jDateChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpnlTimTheoHoaDonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jDateChooser2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(72, 72, 72)
                .addComponent(jpnlTimTheoHoaDon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(89, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jpnlTimTheoHoaDon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 705, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(256, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void jrbtnTimTheoHoaDonItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jrbtnTimTheoHoaDonItemStateChanged
// TODO add your handling code here:
}//GEN-LAST:event_jrbtnTimTheoHoaDonItemStateChanged

private void jrbtnTimTheoPhieuNhapItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jrbtnTimTheoPhieuNhapItemStateChanged
// TODO add your handling code here:
}//GEN-LAST:event_jrbtnTimTheoPhieuNhapItemStateChanged

private void jrbtnTimTheoPhieuNhap1ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jrbtnTimTheoPhieuNhap1ItemStateChanged
// TODO add your handling code here:
}//GEN-LAST:event_jrbtnTimTheoPhieuNhap1ItemStateChanged

private void jrbtnTimTheoPhieuNhap2ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jrbtnTimTheoPhieuNhap2ItemStateChanged
// TODO add your handling code here:
}//GEN-LAST:event_jrbtnTimTheoPhieuNhap2ItemStateChanged

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(frmTimKiemNhanh.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(frmTimKiemNhanh.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(frmTimKiemNhanh.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(frmTimKiemNhanh.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new frmTimKiemNhanh().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private com.toedter.calendar.JDateChooser jDateChooser1;
    private com.toedter.calendar.JDateChooser jDateChooser2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JPanel jpnlTimTheoHoaDon;
    private javax.swing.JRadioButton jrbtnTimTheoHoaDon;
    private javax.swing.JRadioButton jrbtnTimTheoPhieuNhap;
    private javax.swing.JRadioButton jrbtnTimTheoPhieuNhap1;
    private javax.swing.JRadioButton jrbtnTimTheoPhieuNhap2;
    // End of variables declaration//GEN-END:variables
}
